﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PPP.Model.FormatWrapper {
    /// <summary>
    /// Model to handel a paper size.
    /// 
    /// <list type="bullet">
    /// <item>
    /// <term>Author</term>
    /// <description>Sebastian Will</description>
    /// </item>
    /// </list>
    /// 
    /// </summary>
    public class PaperSizeFormatWrapper {
        #region Fields

        /// <summary>
        /// The name of the paper size.
        /// </summary>
        string _name = string.Empty;

        /// <summary>
        /// The height of the paper.
        /// </summary>
        int _height = 0;

        /// <summary>
        /// The width of the paper.
        /// </summary>
        int _width = 0;

        /// <summary>
        /// The uri of the icon.
        /// </summary>
        Uri _icon = null;

        #endregion

        #region Properties
        
        /// <summary>
        /// The name of the paper size.
        /// </summary>
        public string Name {
            get {
                return _name;
            }
        }

        /// <summary>
        /// The size of the paper.
        /// </summary>
        public string Size {
            get {
                return string.Format("{0:N2} cm x {1:N2} cm", Width * 0.0254, Height * 0.0254);
            }
        }

        /// <summary>
        /// The height of the paper.
        /// </summary>
        public int Height {
            get {
                return _height;
            }
        }

        /// <summary>
        /// The width of the paper.
        /// </summary>
        public int Width {
            get {
                return _width;
            }
        }
        
        /// <summary>
        /// The uri of the icon.
        /// </summary>
        public Uri Icon {
            get {
                return _icon;
            }
        }

        #endregion

        #region Constructors

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="name">The name of the paper size.</param>
        /// <param name="height">The height of the paper.</param>
        /// <param name="width">The width of the paper.</param>
        public PaperSizeFormatWrapper(string name, int height, int width) {
            _name = name;
            _height = height;
            _width = width;
            _icon = new Uri("pack://application:,,/icons/gui/pageSize.png");
        }

        #endregion
    }
}
